package com.nebula.stream;

import org.springframework.cloud.stream.annotation.Input;

import org.springframework.cloud.stream.annotation.Output;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.SubscribableChannel;
import org.springframework.stereotype.Component;

/**
 * @Author: llq
 * @Date: 2019/9/27
 */
@Component
public interface MyPipe {
    //方法1
//    @Input(Source.OUTPUT) //Source.OUTPUT的值是output，我们自定义也是一样的
//    SubscribableChannel input(); //使用@Input注解标注的输入管道需要使用SubscribableChannel来订阅通道

    //========二选一使用===========

    //方法2
    String INPUT = "myinput";
    String OUTPUT = "myoutput";

    @Input(MyPipe.INPUT)
    SubscribableChannel input();

    @Output(MyPipe.OUTPUT)
    MessageChannel output();
}
